package cz.hanis.android.geography;

import java.util.List;

import android.content.Context;

import cz.hanis.android.geography.models.Test;


public class TestManager {

	
	public static final int TEST_TYPE_LIFE = 0;
	public static final int TEST_TYPE_TIME = 1;	
	
	private List<Test> mTests;
	private Context mContext;
	
	public TestManager(List<Test> tests, Context context) {
		mTests = tests;
		mContext = context;
	}

	public List<Test> getTests() {
		return mTests;
	}
	
	public Test getTestById(String id) {
		for(Test test : mTests) {
			if(test.getId().equals(id)) {
				return test;
			}
		}
		return null;
	}
	
	public String getTestTypeName(int testType) {
		switch(testType) {
			case TEST_TYPE_LIFE:
				return mContext.getResources().getString(R.string.test_type_life);
			case TEST_TYPE_TIME:
				return mContext.getResources().getString(R.string.test_type_time);
			default:
				return "";
		}
	}

	
}
